package com.example.jikeyoujikeyou.office_sz.view.base;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;

public class OfficeViewPager extends ViewPager {
    boolean isMove = true;

    public OfficeViewPager(Context context) {
        super(context);
    }

    public OfficeViewPager(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public void setMove(boolean move) {
        isMove = move;
    }

    @Override
    public boolean onTouchEvent(MotionEvent ev) {
        if (!isMove) {
            return false;
        }
        return super.onTouchEvent(ev);
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        if (!isMove) {
            return false;
        }
        return super.onTouchEvent(ev);
    }
}
